<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: huajie <banhuajie@163.com>
// +----------------------------------------------------------------------

namespace Common\Model;
use Think\Model\MongoModel;
/**
 * MongoDB 模型
 *
 */
Class OptionModel extends MongoModel{
    Protected $pk = 'id';
    Protected $_idType = self::TYPE_INT;
    protected $autoinc =  true;
    public function __construct($name, $tablePrefix, $connection){
        parent::__construct($name, $tablePrefix, $connection);
        $this->trueTableName=$name;//要连接的那个集合（表）控制器里传过来
    }
    protected $dbName='yxwei';//（要连接的数据库名称）
    protected $connection = array(
        'db_type' => 'mongo',
        'db_user' => '',//用户名(没有留空)
        'db_pwd' => '',//密码（没有留空）
        'db_host' => '127.0.0.1',//数据库地址
        //'db_host' => '192.168.0.115',//数据库地址
        'db_port' => '27017',//数据库端口 默认27017
    );


}
